Lately, many mechanical drive systems have been replaced with electrical drive systems in the automobile industry. JP-A-2004-308752 (US 2006/0207373), JP-A-2004-023932 (US 2003/0222617), JP-B2-3800529 (US 2003/0222617), or JP-A-2009-112151 (US 2009/0108791) describes a shift-by-wire type range switch control system. Specifically, when a driver of a vehicle operates a shift lever to change a shift range of a range change mechanism, the shift range is changed to a target range by controlling a motor of the vehicle based on a signal output by detecting the operation.
In this system, an output shaft is connected to a rotation shaft of the motor through a deceleration mechanism, and the output shaft drives the range change mechanism so as to switch a shift range of an automatic transmission. An encoder, which senses a rotational position of the rotor, is provided to the motor, and outputs a pulse signal. At the time of changing the shift range of the automatic transmission, the motor is rotated to a target rotational position (a target count value), which corresponds to a target range of the automatic transmission, based on a count value of the pulse signals output from the encoder.
In this type of the motor having the encoder, only the rotational amount (the rotational angle) of the rotor from a start position of the rotor can be sensed based on the count value upon the starting. Therefore, the motor cannot be normally driven unless an appropriate measure is taken to obtain a relationship between the count value and the rotational position (exciting phase) of the rotor by sensing an absolute rotational position of the rotor.
In view of the above point, according to JP-B2-3800529, an initial drive learning process is executed in an initial drive operation right after turning on an electric power source. In this learning process, the exciting phase is sequentially changed at a predetermined time schedule based on an open loop control, so that the rotational position of the rotor and the corresponding exciting phase coincide with each other at some timing (at some phase), and the pulse signals output from the encoder are counted upon the rotation of the rotor to learn a relationship among the count value of the encoder, the rotational position of the rotor and the exciting phase at the end of the initial drive operation. Thus, a correction value calculated to correct a deviation of the exciting phase (initial position) with respect to the count value can be learned.
Thereafter, in a normal drive operation, the count value is corrected using the correction value, and the exciting phase is sequentially changed in accordance with the corrected count value.
Because the initial drive learning process is executed immediately after energized, the timing of the initial drive learning process overlaps with a cranking of an engine of the vehicle. If much current flows through an electric load, such as a starter, that requires a large consumption electricity in the initial drive learning process, a voltage supplied to the motor from the power source may have a large declining, and the initial drive learning process may be failed (ended with error such as erroneous learning). If the initial drive learning process is failed, in the normal drive operation after the initial drive operation, a deviation between the count value and the rotational position of the rotor (exciting phase) cannot be corrected. In this case, the motor may not be driven normally.
In JP-A-2009-112151, the motor has an encoder that outputs an A-phase signal and a B-phase signal having a predetermined phase difference therebetween in accordance with rotation of the rotor. At the end time of the initial drive operation, it is determined whether the learning is succeeded or failed based on the pattern of the A-phase signal and the B-phase signal. If it is determined that the learning is failed, the initial drive learning process is re-executed.
However, if the voltage supplied to the motor from the power source is unstable when the initial drive learning process is re-executed, the initial drive learning process may be failed again. In this case, the initial drive learning process may be repeated in the state where the voltage is unstable, and the erroneous correction value may be learned.